package world.criver.h50909.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import world.criver.h50909.dao.daoHome;
import world.criver.h50909.request.reqName;
import world.criver.h50909.response.resHomeAlarm;
import world.criver.h50909.response.resHomeAllEquipmentTotal;
import world.criver.h50909.response.resHomeOneEquipmentTotal;
import world.criver.h50909.service.serHome;

@RestController
@RequestMapping("/home")
public class conHome implements daoHome {
    @Autowired
    private serHome serHome;
    @Override
    @PostMapping("/alarm")
    public resHomeAlarm queryAlarm() {
        return serHome.queryAlarm();
    }
    @Override
    @PostMapping("/total/equipment")
    public resHomeOneEquipmentTotal queryRandomOneEquipmentTotal(@RequestBody reqName info) {
        return serHome.queryRandomOneEquipmentTotal(info);
    }

    @Override
    @PostMapping("/total/all")
    public resHomeAllEquipmentTotal queryAllEquipmentTotal() {
        return serHome.queryAllEquipmentTotal();
    }
}
